<template>
  <div>
    <el-row :gutter="24">
      <el-col :span="8" :offset="8">
        <div class="grid-content"></div>
      </el-col>
    </el-row>
    <el-row :gutter="24">
      <el-col :span="8" :offset="8">
        <el-input v-model="userName" placeholder="请输入账号"></el-input>
        <el-input v-model="userPassword" placeholder="请输入密码"></el-input>
        <el-input
          v-model="userSurnameName"
          placeholder="userSurnameName"
        ></el-input>
        <el-input v-model="userPhone" placeholder="userPhone"></el-input>
        <el-button type="primary" @click="register()">注册</el-button>
      </el-col>
    </el-row>
  </div>
</template>

<script>
export default {
  name: "UserRegister",
  data() {
    return {
      userName: "",
      userPassword: "",
      userSurnameName: "",
      userPhone: "",
    };
  },
  methods: {
    register() {
      let that = this;
      this.axios({
        Headers: {
          "Content-Type": "application/json",
        },
        xhrFields: {
          withCredentials: true,
        },
        method: "post",
        url: this.$constant.url + "/user/register",
        data: {
          username: that.userName,
          userpassword: that.userPassword,
          usersurnamename: that.userSurnameName,
          userphone: that.userPhone,
        },
      });
    },
  },
};
</script>

<style>
</style>
